package cn.com.fattiger.framework.cms.admin.common.service.exception;

public class ServiceException extends Exception {
	private static final long serialVersionUID = -7229192234626174699L;
	public static enum Type {
		UNKNOW, 
		GETUSERINFOFROMSESSION, //从session中取用户信息异常
		DAO_BASE_EXCEPTION,   //dao访问时出现的异常
		RESULT_TYPE_ERROR, //返回结果的数据类型不是预期的类型；不能强制转换
		RESULT_IS_FALSE, //请求的返回结果为 false;
		RESULT_IS_REPEAT,
		PARAM_VALUE_ERROR,	// 请求参数值的原因导致没有结果或异常
		PARAM_NOT_SUPPORT, //不支持的参数值
		ORDER_SUBMIT_ERROR , //生成订单有误
		CRM_ERROR // CRM异常
	
	}
    
	private Type type;

	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

	public ServiceException(String message, Type type) {
		super(message);
		this.type = type;
	}
	public ServiceException(String message, Type type, Throwable cause) {
		super(message, cause);
		this.type = type;
	}
}
